projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fee8f6b
)
cssimagelinear: Make gradient offsets stay in [0, 1]
author
Benjamin Otte
<otte@redhat.com>
Fri, 29 Mar 2019 04:01:33 +0000
(
05:01
+0100)
committer
Benjamin Otte
<otte@redhat.com>
Fri, 29 Mar 2019 08:56:52 +0000
(09:56 +0100)
Fixes linear-gradient reftest
gtk/gtkcssimagelinear.c
patch
|
blob
|
history
diff --git
a/gtk/gtkcssimagelinear.c
b/gtk/gtkcssimagelinear.c
index 1253ed8bf96639a0e3038b1e0d18f817ad843cbf..5487767ae2a24e6efe3007c9257d9a7134f72d49 100644
(file)
--- a/
gtk/gtkcssimagelinear.c
+++ b/
gtk/gtkcssimagelinear.c
@@
-211,7
+211,10
@@
gtk_css_image_linear_snapshot (GtkCssImage *image,
continue;
}
else
- pos = _gtk_css_number_value_get (stop->offset, length) / length;
+ {
+ pos = _gtk_css_number_value_get (stop->offset, length) / length;
+ pos = CLAMP (pos, 0.0, 1.0);
+ }
pos = MAX (pos, offset);
step = (pos - offset) / (i - last);